package com.ocom.common.entity.payconfig;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ocom.common.request.payconfig.DishesIdVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @Description: TODO
 * @Author: 朱晖
 * @Date: 2023/2/20
 **/

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "meal_menu")
public class EntityMealMenu implements Serializable {
	private static final long serialVersionUID = -2164562023041634038L;

	/**
	 * 自增id，主键
	 */
	@TableId(value = "id", type = IdType.AUTO)
	private Integer id;

	private Long comId;
	private Integer merchId;
	private Integer pointId;
	@JsonProperty("mealplanId")
	private Integer mealplanId;
	private Integer days;
	private Integer mealNo;
	private Integer sort;
	@JsonProperty("dishesId")
	private Integer dishesId;
	private Integer priceMode;
	private Integer price;
	private Integer limitedQuantity;

	/**
	 * 创建时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+08")
	@TableField(fill = FieldFill.INSERT)
	private Date createTime;

	/**
	 * 创建人Id
	 */
	private Integer createUserid;

	/**
	 * 更新时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+08")
	@TableField(fill = FieldFill.INSERT)
	private Date updateTime;

	@TableField(exist = false)
	@JsonProperty("dishesList")
	List<DishesIdVo> dishesList=new ArrayList<>();

	@TableField(exist = false)
	@JsonProperty("dishesName")
	String dishesName;

	@TableField(exist = false)
	@JsonProperty("dishesClassId")
	Integer dishesClassId;

}
/**
 * CREATE TABLE `meal_menu` (
 *   `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '排餐计划编号',
 *   `com_id` int(11) NOT NULL COMMENT '单位编号',
 *   `merch_id` int(11) DEFAULT '0' COMMENT '商户编号（0表示单位）',
 *   `point_id` int(11) DEFAULT NULL COMMENT '消费点编号',
 *   `mealplan_id` int(10) NOT NULL,
 *   `days` tinyint(4) DEFAULT '1' COMMENT '第几天',
 *   `meal_no` tinyint(4) DEFAULT '0' COMMENT '餐段编号',
 *   `sort` int(11) DEFAULT '0' COMMENT '排序号',
 *   `dishes_id` int(11) DEFAULT '0' COMMENT '菜品编号',
 *   `price_mode` tinyint(4) DEFAULT '20' COMMENT '11：按重量（50g）；20：例；21：小；22：中；23：大',
 *   `price` int(11) DEFAULT '0' COMMENT '特价。以分为单位。-1表示按统一定价',
 *   `limited_quantity` int(11) DEFAULT '0' COMMENT '限量供应。0表示不限量',
 *   `create_time` datetime DEFAULT NULL COMMENT '生成时间',
 *   `create_userid` int(11) DEFAULT NULL COMMENT '创建人p_id',
 *   `update_time` datetime DEFAULT NULL,
 *   PRIMARY KEY (`id`)
 * ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='餐段菜单';
 */
